/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tkatva.soalog.SoalogEjb.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author tuomas
 */
@Entity
@Table(name = "log_sched")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "LogSched.findAll", query = "SELECT l FROM LogSched l")})
public class LogSched implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "log_sched_id")
    private Integer logSchedId;
    @Column(name = "days_older_to_remove")
    private Integer daysOlderToRemove;
    @Column(name = "log_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date logDate;
    @JoinColumn(name = "log_interface_log_interface_id", referencedColumnName = "log_interface_id")
    @ManyToOne(optional = false)
    private LogInterface logInterfaceLogInterfaceId;

    public LogSched() {
    }

    public LogSched(Integer logSchedId) {
        this.logSchedId = logSchedId;
    }

    public Integer getLogSchedId() {
        return logSchedId;
    }

    public void setLogSchedId(Integer logSchedId) {
        this.logSchedId = logSchedId;
    }

    public Integer getDaysOlderToRemove() {
        return daysOlderToRemove;
    }

    public void setDaysOlderToRemove(Integer daysOlderToRemove) {
        this.daysOlderToRemove = daysOlderToRemove;
    }

    public Date getLogDate() {
        return logDate;
    }

    public void setLogDate(Date logDate) {
        this.logDate = logDate;
    }

    public LogInterface getLogInterfaceLogInterfaceId() {
        return logInterfaceLogInterfaceId;
    }

    public void setLogInterfaceLogInterfaceId(LogInterface logInterfaceLogInterfaceId) {
        this.logInterfaceLogInterfaceId = logInterfaceLogInterfaceId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (logSchedId != null ? logSchedId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LogSched)) {
            return false;
        }
        LogSched other = (LogSched) object;
        if ((this.logSchedId == null && other.logSchedId != null) || (this.logSchedId != null && !this.logSchedId.equals(other.logSchedId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tkatva.soalog.SoalogEjb.entities.LogSched[ logSchedId=" + logSchedId + " ]";
    }
    
}
